package net.anumbrella.seaweedfs.core.topology;

import lombok.Data;
import net.anumbrella.seaweedfs.util.ConnectionUtil;

import java.io.Serializable;

/**
 * @author Administrator
 */
@Data
public class MasterStatus  implements Serializable {

    private String url;
    private boolean isActive;

    public MasterStatus(String url) {
        this.url = ConnectionUtil.convertUrlWithScheme(url);
    }


    @Override
    public boolean equals(Object o) {
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }

        MasterStatus that = (MasterStatus) o;
        return url.equals(that.url);
    }

}